package com.meisupic.copyright.repo;

import com.meisupic.copyright.common.WorksProcessEnum;
import com.meisupic.copyright.domain.po.CopyRightWorks;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

/**
 * creation wuxun
 *
 * @Date 2018/1/19 下午2:25
 */
public interface CopyRightWorksRepo extends JpaRepository<CopyRightWorks, Long>,
    JpaSpecificationExecutor<CopyRightWorks> {


  List<CopyRightWorks> findBySeriesId(String seriesId);

  List<CopyRightWorks> findByResId(String resId);

  List<CopyRightWorks> findCopyRightWorksByCreatorIdAndWorksProcess(Long userId,
      WorksProcessEnum worksProcess);

  List<CopyRightWorks> findTop6ByCreatorIdOrderByCreateTimeDesc(Long userId);

  List<CopyRightWorks> findCopyRightWorksByDciCodeNotNull();

  CopyRightWorks findCopyRightWorksByGoodsIdEquals(Long googsId);

  CopyRightWorks findCopyRightWorksByWorksFullNameIs(String worksFullName);

  CopyRightWorks findCopyRightWorksByWorksFullNameIsAndIdNot(String worksFullName,Long id);

  CopyRightWorks findCopyRightWorksByRCodeIs(String rCode);

}
